#include "led_app.h"

uint8_t ucled = 0;

void Led_Disp(uint8_t ucled_state)
{
    static uint8_t ucled_state_old = 1;

    if (ucled_state_old != ucled_state)
    {
        if (ucled_state)
            DL_GPIO_setPins(LED_PORT, LED_PIN_22_PIN);
        else 
            DL_GPIO_clearPins(LED_PORT, LED_PIN_22_PIN);
        ucled_state_old = ucled_state;
    }
}

void Led_Task(void)
{
    static uint16_t led_star = 0;

    if (++led_star == 500)
    {
        led_star = 0;
        ucled = ucled ? 0 : 1;
    }

    Led_Disp(ucled);
}